package com.chartboost.sdk.impl;

import android.content.Context;
import android.view.KeyEvent;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.RelativeLayout.LayoutParams;
import com.chartboost.sdk.b;
import com.chartboost.sdk.b.a;
import com.chartboost.sdk.b.b;
import org.json.JSONObject;

public class v extends b
{
  private String h = null;

  public v(a parama)
  {
    super(parama);
  }

  protected b.b a(Context paramContext)
  {
    return new a(paramContext, this.h);
  }

  public void a(JSONObject paramJSONObject)
  {
    String str = paramJSONObject.optString("html");
    if (str == null)
      return;
    this.h = str;
    a();
  }

  public class a extends b.b
  {
    public WebView c;

    public a(Context paramString, String arg3)
    {
      super(paramString);
      setFocusable(false);
      this.c = new v.b(v.this, paramString);
      this.c.setWebViewClient(new v.c(v.this, v.this));
      addView(this.c);
      String str;
      this.c.loadDataWithBaseURL("file:///android_asset/", str, "text/html", "utf-8", null);
    }

    protected void a(int paramInt1, int paramInt2)
    {
    }
  }

  private class b extends WebView
  {
    public b(Context arg2)
    {
      super();
      setLayoutParams(new RelativeLayout.LayoutParams(-1, -1));
      setBackgroundColor(0);
      getSettings().setJavaScriptEnabled(true);
    }

    public boolean onKeyDown(int paramInt, KeyEvent paramKeyEvent)
    {
      if (((paramInt == 4) || (paramInt == 3)) && (v.this.a != null))
        v.this.a.a();
      return super.onKeyDown(paramInt, paramKeyEvent);
    }
  }

  private class c extends WebViewClient
  {
    private v b;

    public c(v arg2)
    {
      Object localObject;
      this.b = localObject;
    }

    public void onPageFinished(WebView paramWebView, String paramString)
    {
      super.onPageFinished(paramWebView, paramString);
      if ((this.b != null) && (this.b.c != null))
        this.b.c.a();
    }

    public void onReceivedError(WebView paramWebView, int paramInt, String paramString1, String paramString2)
    {
      if (this.b.d != null)
        this.b.d.a();
    }

    // ERROR //
    public boolean shouldOverrideUrlLoading(WebView paramWebView, String paramString)
    {
      // Byte code:
      //   0: new 41	java/net/URI
      //   3: dup
      //   4: aload_2
      //   5: invokespecial 44	java/net/URI:<init>	(Ljava/lang/String;)V
      //   8: invokevirtual 48	java/net/URI:getScheme	()Ljava/lang/String;
      //   11: astore 4
      //   13: aload 4
      //   15: ldc 50
      //   17: invokevirtual 56	java/lang/String:equals	(Ljava/lang/Object;)Z
      //   20: ifeq +115 -> 135
      //   23: aload_2
      //   24: ldc 58
      //   26: invokevirtual 62	java/lang/String:split	(Ljava/lang/String;)[Ljava/lang/String;
      //   29: astore 5
      //   31: aload 5
      //   33: arraylength
      //   34: invokestatic 68	java/lang/Integer:valueOf	(I)Ljava/lang/Integer;
      //   37: astore 6
      //   39: aload 6
      //   41: invokevirtual 72	java/lang/Integer:intValue	()I
      //   44: iconst_3
      //   45: if_icmpge +52 -> 97
      //   48: aload_0
      //   49: getfield 16	com/chartboost/sdk/impl/v$c:b	Lcom/chartboost/sdk/impl/v;
      //   52: getfield 74	com/chartboost/sdk/impl/v:a	Lcom/chartboost/sdk/b$a;
      //   55: ifnull +15 -> 70
      //   58: aload_0
      //   59: getfield 16	com/chartboost/sdk/impl/v$c:b	Lcom/chartboost/sdk/impl/v;
      //   62: getfield 74	com/chartboost/sdk/impl/v:a	Lcom/chartboost/sdk/b$a;
      //   65: invokeinterface 30 1 0
      //   70: iconst_0
      //   71: ireturn
      //   72: astore_3
      //   73: aload_0
      //   74: getfield 16	com/chartboost/sdk/impl/v$c:b	Lcom/chartboost/sdk/impl/v;
      //   77: getfield 74	com/chartboost/sdk/impl/v:a	Lcom/chartboost/sdk/b$a;
      //   80: ifnull -10 -> 70
      //   83: aload_0
      //   84: getfield 16	com/chartboost/sdk/impl/v$c:b	Lcom/chartboost/sdk/impl/v;
      //   87: getfield 74	com/chartboost/sdk/impl/v:a	Lcom/chartboost/sdk/b$a;
      //   90: invokeinterface 30 1 0
      //   95: iconst_0
      //   96: ireturn
      //   97: aload 5
      //   99: iconst_2
      //   100: aaload
      //   101: astore 7
      //   103: aload 7
      //   105: ldc 76
      //   107: invokevirtual 56	java/lang/String:equals	(Ljava/lang/Object;)Z
      //   110: ifeq +27 -> 137
      //   113: aload_0
      //   114: getfield 16	com/chartboost/sdk/impl/v$c:b	Lcom/chartboost/sdk/impl/v;
      //   117: getfield 74	com/chartboost/sdk/impl/v:a	Lcom/chartboost/sdk/b$a;
      //   120: ifnull +15 -> 135
      //   123: aload_0
      //   124: getfield 16	com/chartboost/sdk/impl/v$c:b	Lcom/chartboost/sdk/impl/v;
      //   127: getfield 74	com/chartboost/sdk/impl/v:a	Lcom/chartboost/sdk/b$a;
      //   130: invokeinterface 30 1 0
      //   135: iconst_1
      //   136: ireturn
      //   137: aload 7
      //   139: ldc 78
      //   141: invokevirtual 56	java/lang/String:equals	(Ljava/lang/Object;)Z
      //   144: ifeq -9 -> 135
      //   147: aload 6
      //   149: invokevirtual 72	java/lang/Integer:intValue	()I
      //   152: iconst_4
      //   153: if_icmpge +27 -> 180
      //   156: aload_0
      //   157: getfield 16	com/chartboost/sdk/impl/v$c:b	Lcom/chartboost/sdk/impl/v;
      //   160: getfield 74	com/chartboost/sdk/impl/v:a	Lcom/chartboost/sdk/b$a;
      //   163: ifnull -93 -> 70
      //   166: aload_0
      //   167: getfield 16	com/chartboost/sdk/impl/v$c:b	Lcom/chartboost/sdk/impl/v;
      //   170: getfield 74	com/chartboost/sdk/impl/v:a	Lcom/chartboost/sdk/b$a;
      //   173: invokeinterface 30 1 0
      //   178: iconst_0
      //   179: ireturn
      //   180: aload 5
      //   182: iconst_3
      //   183: aaload
      //   184: ldc 80
      //   186: invokestatic 86	java/net/URLDecoder:decode	(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
      //   189: astore 12
      //   191: aload 12
      //   193: astore 10
      //   195: aload 6
      //   197: invokevirtual 72	java/lang/Integer:intValue	()I
      //   200: iconst_4
      //   201: if_icmpge +71 -> 272
      //   204: new 88	org/json/JSONObject
      //   207: dup
      //   208: new 90	org/json/JSONTokener
      //   211: dup
      //   212: aload 5
      //   214: iconst_4
      //   215: aaload
      //   216: ldc 80
      //   218: invokestatic 86	java/net/URLDecoder:decode	(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
      //   221: invokespecial 91	org/json/JSONTokener:<init>	(Ljava/lang/String;)V
      //   224: invokespecial 94	org/json/JSONObject:<init>	(Lorg/json/JSONTokener;)V
      //   227: astore 11
      //   229: aload_0
      //   230: getfield 16	com/chartboost/sdk/impl/v$c:b	Lcom/chartboost/sdk/impl/v;
      //   233: getfield 97	com/chartboost/sdk/impl/v:b	Lcom/chartboost/sdk/b$c;
      //   236: ifnull -101 -> 135
      //   239: aload_0
      //   240: getfield 16	com/chartboost/sdk/impl/v$c:b	Lcom/chartboost/sdk/impl/v;
      //   243: getfield 97	com/chartboost/sdk/impl/v:b	Lcom/chartboost/sdk/b$c;
      //   246: aload 10
      //   248: aload 11
      //   250: invokeinterface 102 3 0
      //   255: goto -120 -> 135
      //   258: astore 8
      //   260: aload 8
      //   262: astore 9
      //   264: aconst_null
      //   265: astore 10
      //   267: aload 9
      //   269: invokevirtual 105	java/lang/Exception:printStackTrace	()V
      //   272: aconst_null
      //   273: astore 11
      //   275: goto -46 -> 229
      //   278: astore 9
      //   280: goto -13 -> 267
      //
      // Exception table:
      //   from	to	target	type
      //   0	13	72	java/lang/Exception
      //   180	191	258	java/lang/Exception
      //   195	229	278	java/lang/Exception
    }
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.chartboost.sdk.impl.v
 * JD-Core Version:    0.6.2
 */